package ua.pp.bizon.cripto.file;

import java.io.IOException;
import java.util.List;


public interface IFile {

    /**
     *  make new directory
     *  @return new IPath that look to a new directory
     */
    public abstract IPath mkdir(String lastPathName) throws IOException;
    
    /**
     * recursive delete element
     * @return true if delete was successful
     * @throws IOException
     */
    public abstract boolean delete() throws IOException;

    /**
     * 
     * @return list of this directory
     * @throws IOException
     */
    public abstract List<IPath> ls() throws IOException;

    /**
     * 
     * @return if this object is directory
     * @throws IOException
     */
    public abstract boolean isDirectory() throws IOException;

    /**
     * 
     * @return if this object is writable
     * @throws IOException
     */
    public abstract boolean writable();

    /**
     * 
     * @return if this object exist
     * @throws IOException
     */
    public abstract boolean exists() throws IOException;

    /**
     * 
     * write @param data to new file named @param filename in this directory
     * @throws IOException
     */
    public abstract void write(String filename, byte[] data) throws IOException;
    /**
     * 
     * @return data of this file
     */
    public abstract byte[] read() throws IOException;

}
